/*
    This file is part of FSJController.

    FSJController is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    FSJController is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with FSJController.  If not, see <http://www.gnu.org/licenses/>.
*/

package de.qsc.fsjcontroller;

/**
 * Encapsulates a Freeswitch telephone conference member, that is a single participand within a
 * telephone conference
 * 
 * @author Roland Hänel <rha@qsc.de>
 */
public class FSConferenceMember {

    /**
     * Conference member id and channel uuid, as assigned by FreeSwitch
     */
    int id;
    FSChannel channel;
    String phone;
    boolean talking;
    boolean mute;
    boolean deaf;
    boolean floor;
    int volumeIn;
    int volumeOut;

    public static enum State {
        CALLING, FAILED, ACTIVE, KICKED, GONE
    };

    State state;

    public FSConferenceMember(FSChannel channel) {
        id = 0;
        this.channel = channel;
        talking = false;
        mute = false;
        deaf = false;
        state = State.CALLING;
        phone = this.channel.getFrom();
    }

    /**
     * @param state
     *            the new state of this conference member
     */
    public void setState(State state) {
        this.state = state;
    }

    /**
     * @return the state of this conference member
     */
    public State getState() {
        return state;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getId() {
        return id;
    }

    public void setChannel(FSChannel channel) {
        this.channel = channel;
    }

    public FSChannel getChannel() {
        return channel;
    }

    public String getPhone() {
        return phone;
    }

    public void setTalking(boolean talking) {
        this.talking = talking;
    }

    public boolean isTalking() {
        return talking;
    }

    public void setMute(boolean mute) {
        this.mute = mute;
    }

    public boolean isMute() {
        return mute;
    }

    public void setDeaf(boolean deaf) {
        this.deaf = deaf;
    }

    public boolean isDeaf() {
        return deaf;
    }

    public boolean isFloor() {
        return floor;
    }

    public void setFloor(boolean floor) {
        this.floor = floor;
    }

    public int getVolumeIn() {
        return volumeIn;
    }

    public void setVolumeIn(int volumeIn) {
        this.volumeIn = volumeIn;
    }

    public int getVolumOut() {
        return volumeOut;
    }

    public void setVolumeOut(int volumOut) {
        this.volumeOut = volumOut;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }
}
